from PIL.ImtImagePlugin import field
from django.db import models
from twisted.python.lockfile import unique

from dvadmin.utils.models import CoreModel


# Create your models here.
# 创建影片模型类
class FilmInfo(CoreModel):
    fname = models.CharField(max_length=20, unique=True, verbose_name='影片名称')
    playcount = models.IntegerField(default=0, verbose_name='播放量')
    commentcount = models.IntegerField(default=0, verbose_name='评论量')
    pub_date = models.DateField(null=True, verbose_name='发版时间')
    is_delete = models.BooleanField(default=False, verbose_name='逻辑删除')

    class Meta:
        db_table = 'filminfo'  # 指定数据库表名
        verbose_name = '影片信息'  # 在admin站点中显示的名称

    def __str__(self):
        '''定义每个数据对象的显示信息'''
        return self.fname